<?php //pack11class

class ObjectsListComments {

    private static $comments=array();

    const STAR="*";

    public static function setComment($s,$type=ObjectsListComment::COST) {
        array_push(Tracer::$traceFrom,__CLASS__);
        $comment = new ObjectsListComment();
        $comment->value=$s;
        $comment->type=$type;
        $comment->setBody($s);

        array_push(self::$comments,$comment);
        $commentsSet=array();
        $stars="";
        foreach(self::$comments as $comment) {
            if(!array_key_exists($comment->type, $commentsSet)){
                $stars.=self::STAR;
                $commentsSet[$comment->type]=$comment;
            }
        }
        //print_r(self::$comments);
        //trace(__CLASS__." >>>>>>>>>>>>>>>> ".count(self::$comments)." >> ".$stars);
        return $stars;
    }

    public static function getComments() {
        return self::$comments;
    }
}
?>
